package com.commander.spring.cloud.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * description:
 * <p>
 * Date: 2020-06-04
 * <p>
 * Time: 20:02
 *
 * @author zhangxin
 */
@EnableTransactionManagement
@MapperScan(basePackages = {"com.commander.spring.cloud.dao"})
@Configuration
public class MybatisPlusConfig {
	
	/**
	 * 分页插件
	 */
	@Bean
	public PaginationInterceptor paginationInterceptor() {
		return new PaginationInterceptor();
	}
	
	@Bean
	public OptimisticLockerInterceptor optimisticLockerInterceptor(){
		return new OptimisticLockerInterceptor();
	}
}
